package org.xue.snowmall.seckill.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.xue.snowmall.seckill.entity.SeckillRecordEntity;
import org.xue.snowmall.seckill.service.SeckillRecordService;

import java.util.List;

/**
 * @author 小刘的小张
 * @version 1.0
 * @description: TODO
 * @date 2021/9/29 11:13
 */
@Controller
public class SeckillController {

    @Autowired
    private SeckillRecordService seckillRecordService;
    @RequestMapping("/")
    public String uploadGoods(Model model) {
        //查出所有的已经上架的秒杀商品
        List<SeckillRecordEntity> list = seckillRecordService.uploadGoods();
        model.addAttribute("list",list);
        return "seckillItem";
    }
}
